﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Model
{   
    [Serializable]
    public class GeneralAdviceItem{
        private string _adviceType;
        private string _adviceNum;
        private string _advice;
        private string _person;
        private string _finishDate;

        public GeneralAdviceItem(){}
        public GeneralAdviceItem(string adviceType, string adviceNum, string advice, string person, string finishDate){
            _adviceType = adviceType;
            _adviceNum = adviceNum;
            _advice = advice;
            _person = person;
            _finishDate = finishDate;
        }

        public string AdviceType{
            get { return _adviceType; }
            set { _adviceType = value; }
        }

        public string AdviceNum{
            get { return _adviceNum; }
            set { _adviceNum = value; }
        }

        public string Advice{
            get { return _advice; }
            set { _advice = value; }
        }

        public string Person{
            get { return _person; }
            set { _person = value; }
        }

        public string FinishDate{
            get { return _finishDate; }
            set { _finishDate = value; }
        }

        public override bool Equals(object obj){
            if(obj != null && obj is GeneralAdviceItem){
                GeneralAdviceItem g = (GeneralAdviceItem) obj;
                if(g._adviceType == this._adviceType && this._adviceNum == g.AdviceNum && this.Advice == g.Advice
                    && this.Person == g.Person && this.FinishDate == g.FinishDate){
                    return true;
                }
            }
            return false;
        }
    }
}
